package school.domain;

import java.io.Serializable;
import java.util.ArrayList;

public class School implements Serializable{
	private int schoolId;
	private String schoolName;
	private String schoolAddress;
	private String SchoolTel;
	private String SchoolFlower;
	private int enrollment;

	ArrayList<Student> students;
	
	public School(int schoolId, String schoolName, String schoolAddress,
			String schoolTel, String schoolFlower, int enrollment) {
		super();
		this.schoolId = schoolId;
		this.schoolName = schoolName;
		this.schoolAddress = schoolAddress;
		SchoolTel = schoolTel;
		SchoolFlower = schoolFlower;
		this.enrollment = enrollment;
	}

	public ArrayList<Student> getStudents() {
		return students;
	}

	public void setStudents(ArrayList<Student> students) {
		this.students = students;
	}

	public School() {
		super();
	}

	@Override
	public String toString() {
		return "School [schoolId=" + schoolId + ", schoolName=" + schoolName
				+ ", schoolAddress=" + schoolAddress + ", SchoolTel="
				+ SchoolTel + ", SchoolFlower=" + SchoolFlower + ", enrollment="
				+ enrollment + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((SchoolFlower == null) ? 0 : SchoolFlower.hashCode());
		result = prime * result
				+ ((SchoolTel == null) ? 0 : SchoolTel.hashCode());
		result = prime * result + enrollment;
		result = prime * result
				+ ((schoolAddress == null) ? 0 : schoolAddress.hashCode());
		result = prime * result + schoolId;
		result = prime * result
				+ ((schoolName == null) ? 0 : schoolName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		School other = (School) obj;
		if (SchoolFlower == null) {
			if (other.SchoolFlower != null)
				return false;
		} else if (!SchoolFlower.equals(other.SchoolFlower))
			return false;
		if (SchoolTel == null) {
			if (other.SchoolTel != null)
				return false;
		} else if (!SchoolTel.equals(other.SchoolTel))
			return false;
		if (enrollment != other.enrollment)
			return false;
		if (schoolAddress == null) {
			if (other.schoolAddress != null)
				return false;
		} else if (!schoolAddress.equals(other.schoolAddress))
			return false;
		if (schoolId != other.schoolId)
			return false;
		if (schoolName == null) {
			if (other.schoolName != null)
				return false;
		} else if (!schoolName.equals(other.schoolName))
			return false;
		return true;
	}

	public int getSchoolId() {
		return schoolId;
	}

	public void setSchoolId(int schoolId) {
		this.schoolId = schoolId;
	}

	public String getSchoolName() {
		return schoolName;
	}

	public void setSchoolName(String schoolName) {
		this.schoolName = schoolName;
	}

	public String getSchoolAddress() {
		return schoolAddress;
	}

	public void setSchoolAddress(String schoolAddress) {
		this.schoolAddress = schoolAddress;
	}

	public String getSchoolTel() {
		return SchoolTel;
	}

	public void setSchoolTel(String schoolTel) {
		SchoolTel = schoolTel;
	}

	public String getSchoolFlower() {
		return SchoolFlower;
	}

	public void setSchoolFlower(String schoolFlower) {
		SchoolFlower = schoolFlower;
	}

	public int getenrollment() {
		return enrollment;
	}

	public void setenrollment(int enrollment) {
		this.enrollment = enrollment;
	}

}
